Optimal. Leaf size=91 \[ -\frac {3 \sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 (a+b)^{5/2} f}-\frac {3 \cot (e+f x)}{2 (a+b)^2 f}+\frac {\cot (e+f x)}{2 (a+b) f \left (a+b+b \tan ^2(e+f x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {4217, 296, 331,
211} \begin {gather*} -\frac {3 \sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 f (a+b)^{5/2}}-\frac {3 \cot (e+f x)}{2 f (a+b)^2}+\frac {\cot (e+f x)}{2 f (a+b) \left (a+b \tan ^2(e+f x)+b\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 296
Rule 331
Rule 4217
Rubi steps
\begin {align*} \int \frac {\csc ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=\frac {\text {Subst}\left (\int \frac {1}{x^2 \left (a+b+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\cot (e+f x)}{2 (a+b) f \left (a+b+b \tan ^2(e+f x)\right )}+\frac {3 \text {Subst}\left (\int \frac {1}{x^2 \left (a+b+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{2 (a+b) f}\\ &=-\frac {3 \cot (e+f x)}{2 (a+b)^2 f}+\frac {\cot (e+f x)}{2 (a+b) f \left (a+b+b \tan ^2(e+f x)\right )}-\frac {(3 b) \text {Subst}\left (\int \frac {1}{a+b+b x^2} \, dx,x,\tan (e+f x)\right )}{2 (a+b)^2 f}\\ &=-\frac {3 \sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 (a+b)^{5/2} f}-\frac {3 \cot (e+f x)}{2 (a+b)^2 f}+\frac {\cot (e+f x)}{2 (a+b) f \left (a+b+b \tan ^2(e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 2.55, size = 242, normalized size = 2.66 \begin {gather*} \frac {(a+2 b+a \cos (2 (e+f x))) \sec ^4(e+f x) \left (\frac {3 b \text {ArcTan}\left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (a+2 b+a \cos (2 (e+f x))) (\cos (2 e)-i \sin (2 e))}{\sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}+2 (a+2 b+a \cos (2 (e+f x))) \csc (e) \csc (e+f x) \sin (f x)+\frac {b ((a+2 b) \sin (2 e)-a \sin (2 f x))}{a (\cos (e)-\sin (e)) (\cos (e)+\sin (e))}\right )}{8 (a+b)^2 f \left (a+b \sec ^2(e+f x)\right )^2} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 78, normalized size = 0.86
method | result | size |
derivativedivides | \(\frac {-\frac {b \left (\frac {\tan \left (f x +e \right )}{2 a +2 b +2 b \left (\tan ^{2}\left (f x +e \right )\right )}+\frac {3 \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \sqrt {\left (a +b \right ) b}}\right )}{\left (a +b \right )^{2}}-\frac {1}{\left (a +b \right )^{2} \tan \left (f x +e \right )}}{f}\) | \(78\) |
default | \(\frac {-\frac {b \left (\frac {\tan \left (f x +e \right )}{2 a +2 b +2 b \left (\tan ^{2}\left (f x +e \right )\right )}+\frac {3 \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \sqrt {\left (a +b \right ) b}}\right )}{\left (a +b \right )^{2}}-\frac {1}{\left (a +b \right )^{2} \tan \left (f x +e \right )}}{f}\) | \(78\) |
risch | \(-\frac {i \left (2 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}+a b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+4 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}+8 a b \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+2 a^{2}-a b \right )}{a \left (a +b \right )^{2} f \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}-\frac {3 \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}-a -2 b}{a}\right )}{4 \left (a +b \right )^{3} f}+\frac {3 \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}+a +2 b}{a}\right )}{4 \left (a +b \right )^{3} f}\) | \(260\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 121, normalized size = 1.33 \begin {gather*} -\frac {\frac {3 \, b \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {{\left (a + b\right )} b}} + \frac {3 \, b \tan \left (f x + e\right )^{2} + 2 \, a + 2 \, b}{{\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{3} + {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 169 vs.
\(2 (81) = 162\).
time = 2.96, size = 429, normalized size = 4.71 \begin {gather*} \left [-\frac {4 \, {\left (2 \, a - b\right )} \cos \left (f x + e\right )^{3} - 3 \, {\left (a \cos \left (f x + e\right )^{2} + b\right )} \sqrt {-\frac {b}{a + b}} \log \left (\frac {{\left (a^{2} + 8 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left ({\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{3} - {\left (a b + b^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt {-\frac {b}{a + b}} \sin \left (f x + e\right ) + b^{2}}{a^{2} \cos \left (f x + e\right )^{4} + 2 \, a b \cos \left (f x + e\right )^{2} + b^{2}}\right ) \sin \left (f x + e\right ) + 12 \, b \cos \left (f x + e\right )}{8 \, {\left ({\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} f\right )} \sin \left (f x + e\right )}, -\frac {2 \, {\left (2 \, a - b\right )} \cos \left (f x + e\right )^{3} - 3 \, {\left (a \cos \left (f x + e\right )^{2} + b\right )} \sqrt {\frac {b}{a + b}} \arctan \left (\frac {{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - b\right )} \sqrt {\frac {b}{a + b}}}{2 \, b \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) + 6 \, b \cos \left (f x + e\right )}{4 \, {\left ({\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} f\right )} \sin \left (f x + e\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{2}{\left (e + f x \right )}}{\left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.58, size = 127, normalized size = 1.40 \begin {gather*} -\frac {\frac {3 \, {\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b + b^{2}}}\right )\right )} b}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a b + b^{2}}} + \frac {3 \, b \tan \left (f x + e\right )^{2} + 2 \, a + 2 \, b}{{\left (b \tan \left (f x + e\right )^{3} + a \tan \left (f x + e\right ) + b \tan \left (f x + e\right )\right )} {\left (a^{2} + 2 \, a b + b^{2}\right )}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.40, size = 91, normalized size = 1.00 \begin {gather*} -\frac {\frac {1}{a+b}+\frac {3\,b\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,{\left (a+b\right )}^2}}{f\,\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (a+b\right )\,\mathrm {tan}\left (e+f\,x\right )\right )}-\frac {3\,\sqrt {b}\,\mathrm {atan}\left (\frac {\sqrt {b}\,\mathrm {tan}\left (e+f\,x\right )\,\left (a^2+2\,a\,b+b^2\right )}{{\left (a+b\right )}^{5/2}}\right )}{2\,f\,{\left (a+b\right )}^{5/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________